package com.lcredu.web.datavalid;

import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.NumberFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author 黎长容
 * @date 2025-07-22 16:45
 */
@Data
public class Monster {
    private Integer id;
    @NotEmpty(message = "邮箱不能为空")
    private String email;
    @Range(min = 1, max = 100)
    @NotNull(message = "年龄不能为空")
    private Integer age;
    @NotEmpty
    private String name;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "生日不能为空...")
    private Date birthday;
    @NumberFormat(pattern = "###,####.##")
    @NotNull(message = "薪水不能为空...")
    private Float salary;
}
